import Taro, { Component } from '@tarojs/taro';
import { View, Text, Button } from '@tarojs/components';
import UsedCardRecordFunction from '../../../components/vip-card-record-function';
import NavigationBar from '../../../components/navigationBar/index';
import Time from '../../../static/card/icon_time.png';
import { agentStatistic, } from '../../../services/user';

import './index.scss';

export default class Index extends Component {

  config = {
    navigationBarTitleText: '',
    enablePullDownRefresh: true,
  }

  state = {
    type: 0, // 0 静止状态 1 pulldown 2 reachBottom
    navigationBarHeight: Taro.getStorageSync('navigationBarHeight'),
    viplist: null
  }

  componentWillMount() {
    agentStatistic({
    }).then(res => {
      this.setState({
        viplist: res,
      })
    });
   
  }
  componentDidMount() { }
  componentWillReceiveProps(nextProps, nextContext) { }
  componentWillUnmount() { }
  componentDidShow() { }
  componentDidHide() { }
  componentDidCatchError() { }
  componentDidNotFound() { }
  render() {
    return (
      <View className='card' style={`margin-top: ${navigationBarHeight}`}>
        <NavigationBar  text="代理商数据统计" type="activity" />

        <View className="card-line">
          <Image src={Time} alt="" className="icon" />
          <View>返佣点：{viplist.member_proportion}</View>
        </View>
        <View className="card-line">
          <Image src={Time} alt="" className="icon" />
          <View>名下代理商数量：{viplist.under_agent_num}</View>
        </View>
        <View className="card-line">
          <Image src={Time} alt="" className="icon" />
          <View>卡片激活数量：{viplist.active_num}</View>
        </View>
        <View className="card-line">
          <Image src={Time} alt="" className="icon" />
          <View>名下代理商卡片激活数量：{viplist.under_agent_active_num}</View>
        </View>
        <View className="card-line">
          <Image src={Time} alt="" className="icon" />
          <View>名下用户绑定数量{viplist.under_user_num}</View>
        </View>
        <View className="card-line">
          <Image src={Time} alt="" className="icon" />
          <View>产生的流水笔数总数：{viplist.card_use_num}</View>
        </View>
        <View className="card-line">
          <Image src={Time} alt="" className="icon" />
          <View>佣金总额：{viplist.total_commission}</View>
        </View>
        {/* <View className="card-line">
          <Image src={Time} alt="" className="icon" />
          <View>会员用户名：{viplist.total_commission}</View>
        </View>
        <View className="card-line">
          <Image src={Time} alt="" className="icon" />
          <View>更新时间时间：{viplist.update_time}</View>
        </View> */}

        {/* {
   
        }
        <View className="card-line" >
          <Image src={Kind} alt="" className="icon" />
          {(!type) && <View>兑换规格：{sku}</View>}
          {(type) && <View>类型：{cardType}</View>}
        </View>
        {
          (type === 6) && <View className="card-line" >
            <Image src={Agengcy} alt="" className="icon" />
            <View>代理：{agency}</View>
          </View>
        } */}
      </View>

    );
  }
}
